# main()
snippet main
	/* ======= Function ==================================================
	 *   Name: main
	 *   Description: main entry Function
	 * =================================================================== 
	 */
	int main(int argc, char **argv)
	{
		${1}
		return 0;
	}
snippet mainn
	/* ======= Function ==================================================
	 *   Name: main
	 *   Description: main entry Function
	 * =================================================================== 
	 */
	int main(void)
	{
		${1}
		return 0;
	}
snippet maini
	#include <iostream>
		
	using namespace std;
	
	/* ======= Function ==================================================
	 *   Name: main
	 *   Description: main entry Function
	 * =================================================================== 
	 */
	int main(int argc, char **argv)
	{
		${1}
		return 0;
	}
# #include <...>
snippet inc
	#include <${1:stdio}.h>${2}
# #include "..."
snippet Inc
	#include "${1:`Filename("$1.h")`}"${2}
# #ifndef ... #define ... #endif
snippet Def
	#ifndef $1
	#define ${1:SYMBOL} ${2:value}
	#endif${3}
snippet def
	#define
snippet ifdef
	#ifdef ${1:FOO}
		${2:#define }
	#endif
snippet #if
	#if ${1:FOO}
		${2}
	#endif
# Header Include-Guard
snippet once
	#ifndef ${1:`toupper(Filename('$1_H', 'UNTITLED_H'))`}

	#define $1

	${2}

	#endif /* end of include guard: $1 */
# If Condition
snippet if
	if (${1:/* condition */}) {
		${2:/* code */}
	}
snippet el
	else {
		${1}
	}
# Ternary conditional
snippet t
	${1:/* condition */} ? ${2:a} : ${3:b}
# Do While Loop
snippet do
	do {
		${2:/* code */}
	} while (${1:/* condition */});
# While Loop
snippet wh
	while (${1:/* condition */}) {
		${2:/* code */}
	}
# For Loop
snippet for
	for (int ${2:i} = 0; $2 < ${1:count}; ${3:++}$2) {
		${4:/* code */}
	}
# Custom For Loop
snippet forr
	for (${1:i} = ${2:0}; ${3:$1 < 10}; ${4:++}$1) {
		${5:/* code */}
	}
# Function
snippet fun
	/******** Function ************************************************//**
	 *   @brief		${4:brief description of function $2}
	 *
	 *   @return	${5: 0 if result is positive; -1 if result is negative}
	 *   
	 *********************************************************************/

	${1:void} ${2:function_name}(${3})
	{
		${6}
	}
# Function Declaration
snippet fund
	${1:void} ${2:function_name}(${3});${4}
# Typedef
snippet td
	typedef ${1:int} ${2:MyCustomType};${3}
# Struct
snippet st
	struct ${1:`Filename('$1_t', 'name')`} {
		${2:/* data */}
	}${3: /* optional variable list */};${4}
# Typedef struct
snippet tds
	typedef struct ${2:_$1 }{
		${3:/* data */}
	} ${1:`Filename('$1_t', 'name')`};
# Typdef enum
snippet tde
	typedef enum {
		${1:/* data */}
	} ${2:foo};
# printf
# unfortunately version this isn't as nice as TextMates's, given the lack of a
# dynamic `...`
snippet pr
	printf("${1:%s}\n"${2});${3}
# fprintf (again, this isn't as nice as TextMate's version, but it works)
snippet fpr
	fprintf(${1:stderr}, "${2:%s}\n"${3});${4}
# This is kind of convenient
snippet .
	[${1}]${2}
#print ref_count of selected GStreaner GObject
snippet refpr
	GST_ERROR("${1:gobject} refcount: %d", G_OBJECT($1)->ref_count);
#insert DEAD code (will generate segmentation fault)
snippet dead
	int* deadPtr = NULL;
	*deadPtr = 0xDEAD;
snippet ger
	GST_ERROR("${1}");
snippet gde
	GST_DEBUG("${1}");
snippet gin
	GST_INFO("${1}");
snippet nl
	"\n"
snippet fp 
	fprintf(stderr, "${1}\n"); fsync(stderr);
snippet refas
	if(G_OBJECT(${1:gobject})->ref_count != 1){
		GST_ERROR("!!!!!!!!!!!!!!!!!! $1->ref_count != 1 (== %u)", G_OBJECT($1)->ref_count);
	}
